home *** CD-ROM | disk | FTP | other *** search
/ Workplace Effectiveness:…ecision-Making Strategies / Workplace Effectiveness: Decision-Making Strategies.iso / pc / Files / Review.dxr / 00004_More handlers.ls < prev    next >
Encoding:
Text File  |  1998-12-16  |  2.1 KB  |  72 lines

  1. global gMasterData, gSection, gReviewData
  2.  
  3. on initReviewData
  4.   if voidp(gReviewData) then
  5.     set gReviewData to [#spin: 0, #score: 0, #userdata: [[EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [0, 0, 0, 0], 0, 0, 0, 0, 0, 0, 0, 0]]
  6.   end if
  7.   if the spin of gReviewData <> 0 then
  8.     set the spin of gReviewData to 0
  9.   end if
  10. end
  11.  
  12. on spinFlasher
  13.   global gFlashTime
  14.   set vFlashSprite to 4
  15.   set vNewTime to the ticks
  16.   if vNewTime > (gFlashTime + 60) then
  17.     set vThisName to the name of member the member of sprite vFlashSprite
  18.     case vThisName of
  19.       "spin1":
  20.         set the member of sprite vFlashSprite to member "spin2"
  21.       "spin2":
  22.         set the member of sprite vFlashSprite to member "spin1"
  23.     end case
  24.     set gFlashTime to the ticks
  25.   end if
  26. end
  27.  
  28. on spinDone
  29.   set the spin of gReviewData to the spin of gReviewData + 1
  30.   set vSpin to the spin of gReviewData
  31.   setTitleArt(vSpin)
  32.   if vSpin = 1 then
  33.     restoreFirst()
  34.   end if
  35.   go("r" & string(the spin of gReviewData))
  36.   voiceQuestion(vSpin)
  37. end
  38.  
  39. on setTitleArt vSpin
  40.   set vTitleSprite to 2
  41.   case vSpin of
  42.     1:
  43.       set the member of sprite vTitleSprite to member "process"
  44.     6:
  45.       set the member of sprite vTitleSprite to member "strategies"
  46.     11:
  47.       set the member of sprite vTitleSprite to member "cost/benefit"
  48.     16:
  49.       set the member of sprite vTitleSprite to member "ind/group"
  50.     21:
  51.       set the member of sprite vTitleSprite to member "group2"
  52.   end case
  53. end
  54.  
  55. on voiceQuestion vSpin
  56.   set vAudioFiles to ["163", "164", "165", "166", "167", "168", "169", "170", "171", "172", "173", "174", "175", "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187"]
  57.   goNarrator(gMasterData, getAt(vAudioFiles, vSpin))
  58. end
  59.  
  60. on restoreFirst
  61.   set vAnswers to getAt(the userdata of gReviewData, 1)
  62.   if vAnswers = [EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY] then
  63.     repeat with X = 1 to 6
  64.       set the text of member ("qfield" & string(X)) to EMPTY
  65.     end repeat
  66.   else
  67.     repeat with X = 1 to 6
  68.       set the text of member ("qfield" & string(X)) to getAt(vAnswers, X)
  69.     end repeat
  70.   end if
  71. end
  72.